class CertParser():
    def __init__(self):
        ""
    def __repr__(self):
        return "CertParser class"
    def ExtractPubKey(self, cert):
        pub_key = cert.get_pubkey()
        return pub_key
    def ParsePubKey(self, pub_key):
        modulus = pub_key.get_modulus()
        size = pub_key.size()*8
        rsa_key = pub_key.get_rsa()
        rsa_pem = rsa_key.as_pem()
        return [rsa_pem, modulus, size]
    def ParseX509(self, cert):
        fingerprint = cert.get_fingerprint()
        issuer = cert.get_issuer().as_text()
        not_after = cert.get_not_after()
        not_before = cert.get_not_before()
        serial_number = str(cert.get_serial_number())
        subject = cert.get_subject().as_text()
        version = cert.get_version()
        return [fingerprint, issuer, not_after, not_before, serial_number, subject, version]